from flask import current_app
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand

from info import create_app, db
from info import models

# 需求：只修改manage.py文件中的相应代码
# 获取不同配置环境下的app对象
app = create_app('developement')

manager = Manager(app)
Migrate(app, db)

# 添加命令行迁移命令db
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    # app.run()
    manager.run()